﻿@{var ks = new Hotel_application.Models.KhachSanEntities(); }

<!--<script src="/Scripts/ajax-Room-Search.js" type="text/javascript"></script>-->
<div id="Search">
    @foreach (var l in ViewData.Model)
    { 
        <div>
            <a id = '@l.maPhong' class="showInfor">@l.maPhong - @l.tenLoai - @l.tenHang</a>
            <div class = 'hidden cusBox'id="info_@l.maPhong">
                <label class='blockA'>Loại phòng </label>
                <select class="blockB" id="maLoai_@l.maPhong">
                    @foreach (var m in ks.LoaiPhongs)
                    {
                        if (l.maLoai == m.maLoai)
                        { 
                            <option selected="selected" value="@m.maLoai">@m.tenLoai</option>
                        }
                        else
                        {
                            <option value="@m.maLoai">@m.tenLoai</option> 
                        }

                    }
                </select> 
                <label class='blockA'>Hạng phòng </label>
                <select class="blockB" id="maHang_@l.maPhong">
                    @foreach (var m in ks.HangPhongs)
                    {
                        if (l.maHang == m.maHang)
                        { 
                            <option selected="selected" value="@m.maHang">@m.tenHang</option>
                        }
                        else
                        {
                            <option value="@m.maHang">@m.tenHang</option> 
                        }

                    }
                </select> 
                <br />
                <label class='blockA'>Thuộc tầng </label>
                <select class="blockB" id="maTang_@l.maPhong" >
                    @foreach (var m in ks.Tangs)
                    {
                        if (l.thuocTang == m.maTang)
                        { 
                            <option selected="selected" value="@m.maTang">Tầng @m.tenTang</option>
                        }
                        else
                        {
                            <option value="@m.maTang">Tầng @m.tenTang</option> 
                        }

                    }
                </select> 
                <label class='blockA'>Thuộc dãy </label>
                <select class="blockB" id="maDay_@l.maPhong">
                    @foreach (var m in ks.DayPhongs)
                    {
                        if (l.thuocDay == m.maDayPhong)
                        { 
                            <option selected="selected" value="@m.maDayPhong">Dãy @m.tenDayPhong</option>
                        }
                        else
                        {
                            <option value="@m.maDayPhong">Dãy @m.tenDayPhong</option> 
                        }

                    }
                </select> 
                <br />
                <div id="notice_@l.maPhong"></div>
                <a id="_@l.maPhong" class="update btnInner"><img class="img" src="~/Images/icon/24_edit.png" /></a>
                <a id="=@l.maPhong" class="delete btnInner"><img class="img" src="~/Images/icon/24_trash.png" /></a>
            </div>
        </div>
        
    }
</div>
<div id="blockAdd">
    
    <a id="btn_add_room" class="btnAdd">Thêm</a>
    <div class = 'hidden_new cusBox' id="info_new">
       <label class='blockA'>Loại phòng </label>
        <select class="blockB" id="maLoai_new">
            <option selected="selected" value="">Chọn loại phòng</option>
            @foreach (var m in ks.LoaiPhongs)
            {
                    <option value="@m.maLoai">@m.tenLoai</option> 
            }
        </select> 
        <label class='blockA'>Hạng phòng </label>
       <select class="blockB" id="maHang_new">
            <option selected="selected" value="">Chọn hạng phòng</option>
            @foreach (var m in ks.HangPhongs)
            {
                    <option value="@m.maHang">@m.tenHang</option> 
            }
        </select>
        <br />
        <label class='blockA'>Thuộc tầng </label>
        <select class="blockB" id="maTang_new">
            <option selected="selected" value="">Chọn tầng</option>
            @foreach (var m in ks.Tangs)
            {
                    <option value="@m.maTang">@m.tenTang</option> 
            }
        </select>
        <label class='blockA'>Thuộc dãy </label>
        <select class="blockB" id="maDay_new">
            <option selected="selected" value="">Chọn dãy</option>
            @foreach (var m in ks.DayPhongs)
            {
                    <option value="@m.maDayPhong">@m.tenDayPhong</option> 
            }
        </select>
        <br />
        <div id="notice_new"></div>
        <a id="btn_add" class="add btnAddNewRoom"><img src="~/Images/icon/plus.png" /></a>
    </div>
</div>
